package com.aidex.system.mapper;

import com.aidex.common.core.mapper.BaseMapper;
import com.aidex.system.domain.Waybill;
import com.aidex.system.domain.vo.CountInfoVO;
import com.aidex.system.domain.vo.WaybillQueryVO;
import com.aidex.system.domain.vo.WaybillQueryVO1;
import com.aidex.system.domain.vo.WaybillVO;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

/**
 * 运单管理Mapper接口
 * @author jmy
 * @email jmyinjg@163.com
 * @date 2021-10-04
 */
public interface WaybillMapper extends BaseMapper<Waybill> {

    /**
     * 批量删除运单管理
     * @param ids 需要删除的运单管理ID集合
     * @return
     */
    int deleteWaybillByIds(String[] ids);

    void deleteWaybillByBillno(@Param("waybillNo") String waybillNo);

    Waybill getByBillno(@Param("waybillNo") String waybillNo, @Param("dataSource") String dataSource);

    List<WaybillVO> page(WaybillQueryVO query);

    List<WaybillVO> page1(WaybillQueryVO1 query);

    List<Waybill> findListByFlight(@Param("flightNo") String flightNo, @Param("flightDate") Date flightDate);

    /**
     * 批量获取未处理的单据列表
     *
     * @param limit
     * @return
     */
    List<Waybill> getUnHandleBillList(@Param("limit") Integer limit);

    /**
     * 查询
     * @param query
     * @return
     */
    List<CountInfoVO> countInfo(@Param("param") WaybillQueryVO query);

    /**
     * 查询
     * @param query
     * @return
     */
    List<CountInfoVO> countInfoBy(@Param("param") WaybillQueryVO query);

    /**
     * 批量获取未推送单据列表
     *
     * @param limit
     * @return
     */
    List<Waybill> getUnSendBillList(@Param("limit") Integer limit);

    Waybill getUnSend(@Param("waybillNo")  String waybillNo);
}
